<!DOCTYPE html>
<html>

<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
        body,
        html {
            width: 100%;
            height: 100%;
            margin: 0;
            font-family: "微软雅黑";
        }

        #allmap {
            width: 100%;
            height: 100%;
        }

        p {
            margin-left: 5px;
            font-size: 14px;
        }
    </style>

    <script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=U3q69k0Dv0GCYNiiZeHPf7BS"></script>
    <script src="../dist/inmap.js"></script>
    <script src="./data/heatData.js"></script>

</head>

<body>
    <div id="allmap"></div>
</body>

</html>
<script>
    var map = new inMap.Map({
        id: document.getElementById('allmap'),
        skin: "Blueness",
        center: [117.294036, 39.43691],
        zoom: {
            value: 10,
            show: true,
            max: 11,
            min: 8
        }
    })

    var overlay = new inMap.GriddingOverlay({
        tooltip: {
            show: true,
            formatter: function (val) {
                return val.count;
            }

        },
        style: {
            type: "avg",
            normal: {
                size: 10,
                unit: 'px', //单位像素
                padding: 1
            },
            mouseOver: {
                shadowColor: 'rgba(255, 250, 255, 1)',
                shadowBlur: 20,
            },
            selected: {
                backgroundColor: 'rgba(184,0,0,1)',
            },
            splitList: [{
                    start: 0,
                    end: 5,
                    backgroundColor: "rgba(31,98,1,1)",
                },
                {
                    start: 5,
                    end: 15,
                    backgroundColor: "rgba(95,154,4,1)"
                },
                {
                    start: 15,
                    end: 30,
                    backgroundColor: "rgba(139,227,7,1)"
                },
                {
                    start: 30,
                    end: 900,
                    backgroundColor: "rgba(218,134,9,1)"
                },
                {
                    start: 900,
                    backgroundColor: "rgba(220,54,6,1)"
                },
            ],
        },
        data: data,
        event: {
            onState(state) {
                console.log(state);
            },
            onMouseClick(data, event) {
                console.log(data, event);
            }

        }
    });
    map.add(overlay)
</script>